<template>
  <div>
    <el-dialog
        :title="config.title"
        v-el-drag-dialog
        :visible="config.show===true"
        :before-close="handleClose"
    >
      <div v-html="config.innerHtml"></div>
      <span slot="footer" class="dialog-footer">
          <el-button type="primary" @click="handleOk">{{ config.okBtnText }}</el-button>
          <el-button @click="handleClose">取消</el-button>
        </span>
    </el-dialog>
  </div>
</template>

<script>
import elDragDialog from '@/views/resource/dialogEditForm/editServiceQuery'

export default {
  name: "defaultDialog",
  props: {
    config: {
      type: Object,
      default() {
        return {
          title: "",
          show: false,
          innerHtml: "",
          okBtnText: "确定",
          handleOk: undefined
        }
      }
    },
    param: {
      type: Object,
      default() {
        return {};
      }
    },
    form: {
      type: Object,
      default() {
        return {
          operatetype: "",
          id: ""
        }
      }
    },
  },
  directives: {//到这里了，看看自定义组件怎么个用法
    elDragDialog,
  },
  methods:{
    handleOk(){
      this.config.handleOk(this.form);
    },
    handleClose() {
      let that = this;
      that.config.show = false;
    },
  }
}
</script>

<style scoped>

</style>
